using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
	[Table("bgm_request_expense"), DataContract]
    public class RequestExpense
    {
        public RequestExpense()
        {
        }
    

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "ReqExpId", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("bgm_req_exp_seq", TypeName="int")]
        public int ReqExpId { get; set; }

        [ForeignKey("Request")]
		[DataMember, Display(Name = "ReqId", ResourceType = typeof(Resources.RequestExpenseResource))]
        [Column("bgm_req_seq", TypeName="int")]
        public Nullable<int> ReqId { get; set; }

		[DataMember, Display(Name = "Descr", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("descr", TypeName="ntext")]
        public string Descr { get; set; }

		[DataMember, Display(Name = "TotalAmount", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("total_amount", TypeName="decimal")]
        public Nullable<decimal> TotalAmount { get; set; }

		[DataMember, Display(Name = "Remark", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("remark", TypeName="ntext")]
        public string Remark { get; set; }

		[DataMember, Display(Name = "Mtef1", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("mtef1", TypeName="decimal")]
        public Nullable<decimal> Mtef1 { get; set; }

		[DataMember, Display(Name = "Mtef2", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("mtef2", TypeName="decimal")]
        public Nullable<decimal> Mtef2 { get; set; }

		[DataMember, Display(Name = "Mtef3", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("mtef3", TypeName="decimal")]
        public Nullable<decimal> Mtef3 { get; set; }

        [ForeignKey("MasBudgetSource")]
        [DataMember, Display(Name = "BgSourceId", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("bgm_source_seq", TypeName="int")]
        public Nullable<int> BgSourceId { get; set; }

        [ForeignKey("MasBudgetExpense")]
        [DataMember, Display(Name = "BgExpId", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("bgm_exp_seq", TypeName="int")]
        public Nullable<int> BgExpId { get; set; }

        [ForeignKey("MasResourceItem")]
		[DataMember, Display(Name = "ResItemId", ResourceType = typeof(Resources.RequestExpenseResource))]
        [Column("icm_res_item_seq", TypeName="int")]
        public Nullable<int> ResItemId { get; set; }

		[DataMember, Display(Name = "UnitPrice", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("unit_price", TypeName="decimal")]
        public Nullable<decimal> UnitPrice { get; set; }

		[DataMember, Display(Name = "UnitQty", ResourceType = typeof(Resources.RequestExpenseResource))]
		[Column("unit_qty", TypeName="int")]
        public Nullable<int> UnitQty { get; set; }

        [DataMember]
        public virtual Request Request { get; set; }

        [DataMember]
        public virtual MasBudgetSource MasBudgetSource { get; set; }

        [DataMember]
        public virtual MasBudgetExpense MasBudgetExpense { get; set; }

        [DataMember]
        public virtual ICM.MasResourceItem MasResourceItem { get; set; }



        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}